from libs.exception import BaseHTTPException
from flask_babel import gettext as _

class HOrderNotFoundError(BaseHTTPException):
    error_code = "order_notfound_error"
    code = 400
    def __init__(self,order_id:str|None):
        order_id = order_id or ""
        self.description = _("Order not found error.{message}").format(message=order_id)
        super().__init__(self.description)


class HOrderParameterError(BaseHTTPException):
    error_code = "order_param_error"
    code = 400
    def __init__(self,message:str|None):
        message = message or ""
        self.description = _("Order parameter error.{message}").format(message=message)
        super().__init__(self.description)